// Global variable for context path
var ezopsContextPath = '/EZOPSDashboardUIDev';

/** Alert messages function Start**/

/**
 * Use this alert for Error Message
 * @param message
 */
function showAlertError(message) {
	$('.alert-fixed').removeClass('alert-info');
	$('.alert-fixed').removeClass('alert-success');
	$('.alert-fixed').removeClass('alert-danger');

	$('.alert-fixed').addClass('alert-danger').fadeIn(500);
	$('.alert-fixed span').html(message);
	$('.alert .close').click(function() {
		$('.alert-fixed').fadeOut(500);
	});
}
/**
 * Use this alert for Success Message
 * @param message
 */
function showAlertSuccess(message) {
	$('.alert-fixed').removeClass('alert-info');
	$('.alert-fixed').removeClass('alert-success');
	$('.alert-fixed').removeClass('alert-danger');

	$('.alert-fixed').addClass('alert-success').fadeIn(500);
	$('.alert-fixed span').html(message);
	$('.alert .close').click(function() {
		$('.alert-fixed').fadeOut(500);
	});
}
/**
 * Use this alert for Info Message
 * @param message
 */
function showAlertInfo(message) {
	$('.alert-fixed').removeClass('alert-info');
	$('.alert-fixed').removeClass('alert-success');
	$('.alert-fixed').removeClass('alert-danger');
	$('.alert-fixed').addClass('alert-info').fadeIn(500);
	$('.alert-fixed span').html(message);
	$('.alert .close').click(function() {
		$('.alert-fixed').fadeOut(500);
	});
}
/**
 * Use this alert for Warning Message
 * @param message
 */
function showAlertWarning(message) {
	$('.alert-fixed').removeClass('alert-info');
	$('.alert-fixed').removeClass('alert-success');
	$('.alert-fixed').removeClass('alert-danger');
	$('.alert-fixed').addClass('alert-warning').fadeIn(500);
	$('.alert-fixed span').html(message);
	$('.alert .close').click(function() {
		$('.alert-fixed').fadeOut(500);
	});
}
/** Alert messages function End**/

/*$(document).ready(function() {
 $('.allbox').click(function(event) {
 if (this.checked) {
 $('#removesorting').unbind('click');
 // Iterate each checkbox
 $(':checkbox').each(function() {
 this.checked = true;
 });
 }
 if (!this.checked) {

 // Iterate each checkbox
 $(':checkbox').each(function() {
 this.checked = false;
 });
 }
 });
 });


 * $(document).ready(function (){ $('#mappingtbl').dataTable(); });


 function addFieldMappingsRow(element) {
 addRows(element);
 }

 function addRows(element) {
 $i = 0;
 try {
 section = $(element).parent().parent().parent().parent().parent()
 .parent().attr('id');
 blankrows = $('#' + section + ' .temp-input').html();
 numbers = $('#' + section + ' .num-rows').val();

 while ($i < numbers) {
 $(element).parent().parent().before(
 '<tr class="pending-row dataRow">' + blankrows + '</tr>');
 // $('.ordering'+$i).focus();
 $i = $i + 1;
 }
 $('.pending-row').removeClass('pending-row');

 } catch (e) {
 // Error occurred
 return "";
 }

 }

 function deleteRows() {
 jQuery.each(jQuery('#fieldMappingtbl').find('td > input:checkbox:checked'),
 function() {
 var checkboxObj = jQuery(this);
 var rowObj = checkboxObj.parent().parent();
 rowObj.remove();

 });
 }

 $(document).ready(function() {
 $("input[type=checkbox]").click(function(event) {
 if ($("input:checkbox:checked").length != 0) {
 $(".btn-saveOrUpdate").prop("disabled", false);
 $(".btn-del").prop("disabled", false);
 $(".btn-upload").prop("disabled", false);
 } else {
 $(".btn-saveOrUpdate").prop("disabled", true);
 $(".btn-del").prop("disabled", true);
 $(".btn-upload").prop("disabled", true);
 }
 });
 });*/